from django.urls import path
from django.views.decorators.http import require_GET, require_POST
from account import views


urlpatterns = [
    # path('login/', csrf_exempt(require_POST(views.LoginAPI.as_view()))),
    # 登录注册 用户信息
    path('login/', require_POST(views.LoginAPI.as_view())),
    path('register/', require_POST(views.RegisterAPI.as_view())),
    path('log-out/', require_GET(views.LogOut.as_view())),
    path('change-password/', require_POST(views.ChangePassword.as_view())),

    # 用户信息查看与更改
    path('user-info/', require_GET(views.UserInfo.as_view())),
    path('update-user-info/', require_POST(views.UpdateUserInfo.as_view())),
    path('upload-avatar/', require_POST(views.UploadAvatar.as_view())),

    # 分类
    path('create-classify/', require_POST(views.CreateClassify.as_view())),
    path('list-classify/', require_GET(views.ListClassify.as_view())),

    # 标签
    path('create-tag/', require_POST(views.CreateTag.as_view())),
    path('list-tag/', require_GET(views.ListTags.as_view())),
    path('delete-tag/', require_GET(views.DeleteTags.as_view())),
    path('modify-tag/', require_POST(views.ModifyTag.as_view())),

    # 关注
    path('attention-user/', require_GET(views.AttentionUser.as_view())),
    path('cancel-attention-user/', require_GET(views.CancelAttentionUser.as_view())),
    path('check-attention-info/', require_GET(views.CheckAttentionInfo.as_view())),
    path('list-attention-user/', require_GET(views.ListAttentionUser.as_view())),
    path('get-fans-count/', require_GET(views.FansCount.as_view())),

    # 收藏
    path('collect-article/', require_GET(views.CollectArticle.as_view())),
    path('cancel-collect-article/', require_GET(views.CancelCollectArticle.as_view())),
    path('list-collect-article/', require_GET(views.ListCollectArticle.as_view())),

    # 图片验证码
    path('image-code/<uuid:uuid>/', views.ImageCodeAPI.as_view()),


]
